package com.college_career_system.controller;


import com.college_career_system.service.SubmitRecruitService;
import com.college_career_system.utils.Constant;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Empty
 * @since 2022-12-04
 */
@Controller
@RequestMapping("/submitRecruit")
@CrossOrigin(origins = Constant.URL, allowCredentials = "true", maxAge = 3600)
public class SubmitRecruitController {

    private final SubmitRecruitService submitRecruitService;

    public SubmitRecruitController(SubmitRecruitService submitRecruitService) {
        this.submitRecruitService = submitRecruitService;
    }

    /**
     * 用户向招聘单位提交简历
     * 传入参数：招聘id、企业的id
     * @param request
     * @param recruitId
     * @param enterpriseId
     * @return
     */
    @PostMapping("/addSubmitRecruit")
    @ResponseBody
    public String addSubmitRecruit(HttpServletRequest request, Integer recruitId, String enterpriseId){
        return submitRecruitService.addSubmitRecruit(request, recruitId, enterpriseId).toString();
    }
}

